-
Notifications
You must be signed in to change notification settings - Fork 35
Light Calorimetry: add sim energy deposit info and light calo info into cafs #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
@lynnt20 could you nominate reviewers please? |
sbncode v10_14_02 for larsoft v10_14_02
|
@PetrilloAtWork would you mind taking a look at this PR? It's the last of the light calorimetry stack of PRs 😃 Thank you advance! |
sbncode v10_14_02_01 for larsoft v10_14_02_01
henrylay97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good. Couple of small queries before I approve :D
|
@PetrilloAtWork: when you have a moment, could you review this PR? |
PetrilloAtWork
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR is generally ok.
I requested the removal of the intermediate vector of art pointers, which is a bad practice being propagated since ages that I am trying to extinguish.
In addition, there are version number changes that should be left to the release managers. I am not sure what is going on, since it appears a release branch was merged here, and then this PR is requested to be merged with develop. If this is really what is needed, the merge of the release should happen before this PR is merged. Maybe that's the plan and I don't know it.
| std::vector<art::Ptr<sim::SimEnergyDeposit>> seds; | ||
| if (sed_handle.isValid()){ | ||
| art::fill_ptr_vector(seds, sed_handle); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to create a vector of art pointers in this code. I'll mark the changes later.
| std::vector<art::Ptr<sim::SimEnergyDeposit>> seds; | |
| if (sed_handle.isValid()){ | |
| art::fill_ptr_vector(seds, sed_handle); | |
| } |
| for (size_t n_dep=0; n_dep < seds.size(); n_dep++){ | ||
| auto sed = seds[n_dep]; | ||
| const auto trackID = sed->TrackID(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the vector of pointers:
| for (size_t n_dep=0; n_dep < seds.size(); n_dep++){ | |
| auto sed = seds[n_dep]; | |
| const auto trackID = sed->TrackID(); | |
| for (sim::SimEnergyDeposit const& sed: *sed_handle){ | |
| const auto trackID = sed.TrackID(); |
The three dereference operators below should also be changed: sed-> → sed..
| // get sim energy deposits if they're there | ||
| ::art::Handle<std::vector<sim::SimEnergyDeposit>> sed_handle; | ||
| GetByLabelStrict(evt, fParams.SimEnergyDepositLabel().encode(), sed_handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest that the reading of the data product be moved close to where it is used first ([CF-021]).
| const sbn::LightCalo *slcLightCalo = nullptr; | ||
| if (foLightCalo.isValid()) { | ||
| slcLightCalo = foLightCalo.at(0).get(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can compact this using the ternary operator:
| const sbn::LightCalo *slcLightCalo = nullptr; | |
| if (foLightCalo.isValid()) { | |
| slcLightCalo = foLightCalo.at(0).get(); | |
| } | |
| const sbn::LightCalo *slcLightCalo = foLightCalo.isValid()? foLightCalo.at(0).get(): nullptr; |
| genie_xsec v3_06_00 - | ||
| larcv2 v2_2_6 - | ||
| larsoft v10_14_02 - | ||
| larsoft v10_14_02_01 - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this change from the PR (it can stay in your working area, if you need it). It is up to the release managers to update the dependencies.
|
|
||
| find_package(cetmodules 3.20.00 REQUIRED) | ||
| project(sbncode VERSION 10.14.02 LANGUAGES CXX) | ||
| project(sbncode VERSION 10.14.02.01 LANGUAGES CXX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, this is release manager task.
Description
Adds info from
SimEnergyDepositsand light calorimetry into cafmaker.SBND is currently keeping
SimEnergyDepositsthroughout the workflow. We can take better advantage of this information (truth level number of electrons, photons, and true energy deposits for true neutrino interactions) by adding it to the cafs in a new class calledSRTrueDeposit. Default will be empty if noSimEnergyDeposits are available in the input files. Only adds 3 floats per neutrino interaction (obtained from length ofMCTruth).Accompanying PRs: SBNSoftware/sbndcode#878, SBNSoftware/sbnanaobj#181, SBNSoftware/sbnobj#158